<template>
	<view class="page-container">

		<view class="wallet-base-block">
			<view class="wallet-base-block__info">
				<text class="explain">账号余额（元）</text>
				<text class="amount">{{amount}}</text>
			</view>
		</view>

		<view class="table-view-group">
			<view class="table-cell-bar" @click="jumpSelect">
				<view class="table-cell-block">
					<view class="table-cell-block__hd">
						<image class="wallet-icon" src="../../static/wallet_icon.png" mode="aspectFit"></image>提现
					</view>
					<view class="table-cell-block__fd">
						<text class="iconfont">&#xe67f;</text>
					</view>
				</view>
			</view>
		</view>

		<view class="table-view-group">
			<view class="table-cell-bar" @click="jumpBusiness">
				<view class="table-cell-block">
					<view class="table-cell-block__hd">交易明细</view>
					<view class="table-cell-block__fd">
						<text class="iconfont">&#xe67f;</text>
					</view>
				</view>
			</view>
			<view class="table-cell-bar" @click="jumpRecord">
				<view class="table-cell-block">
					<view class="table-cell-block__hd">提现记录</view>
					<view class="table-cell-block__fd">
						<text class="iconfont">&#xe67f;</text>
					</view>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	var app = getApp();
	import {apiUrl} from '@/api/base.js'
	export default {
		data() {
			return {
				amount: '0.00'
			}
		},
		onLoad() {
			
		},
		onShow() {
			this.getAmount();
		},
		methods: {
			//判断是否登录
			getAmount: function() {
				var that = this
				uni.request({
					url: apiUrl + "addons/car/fenxiao/getAmount",
					data: {
						user_id: uni.getStorageSync("userInfo").user_id
					},
					method: "GET",
					success: (res) => {
						that.amount = res.data.data
					},
					fail: (res) => {
						console.log(res)
					}
				})
			},
			// 选择提现
			jumpSelect() {
				uni.navigateTo({
					url: './select'
				})
			},

			// 跳转交易明细
			jumpBusiness() {
				uni.navigateTo({
					url: './business'
				})
			},

			// 跳转提现记录
			jumpRecord() {
				uni.navigateTo({
					url: './record'
				})
			}

		}
	}
</script>

<style lang="scss">
	.wallet-base-block {
		padding: 72rpx 40rpx 120rpx;
		position: relative;
		background-color: $uni-bg-color-primary;

		&__info {
			.explain {
				color: $uni-text-color-inverse;
				display: block;
				opacity: 0.7;
				font-size: 26rpx;
			}

			.amount {
				color: $uni-text-color-inverse;
				display: block;
				margin-top: 12rpx;
				font-size: 80rpx;
				font-weight: bold;
				font-family: Arial, Helvetica, sans-serif;
			}
		}

		&__txt {
			color: $uni-text-color-inverse;
			padding: 16rpx 40rpx;
			position: absolute;
			left: 0;
			right: 0;
			bottom: 0;
			font-size: 22rpx;
			background-color: rgba(0, 0, 0, .1);
		}
	}

	.table-view-group {
		margin-bottom: 20rpx;
		background-color: $uni-bg-color;
	}

	.table-cell-bar {
		padding: 0 20rpx;
		position: relative;

		&:after {
			content: "";
			position: absolute;
			right: 0;
			left: 0;
			bottom: 0;
			height: 1px;
			-webkit-transform: scaleY(0.5);
			transform: scaleY(0.5);
			background-color: $uni-border-color;
		}

		&:last-child:after {
			display: none;
		}
	}

	.table-cell-block {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 24rpx 0;

		&__hd {
			flex: 0 0 auto;
			width: 180rpx;
			height: 48rpx;
			line-height: 48rpx;
			font-size: $uni-font-size-base;
		}

		&__bd {
			flex: 1 1 auto;
		}

		&__fd {
			height: 48rpx;
			line-height: 48rpx;
			flex: 0 0 auto;

			.iconfont {
				display: inline-block;
				vertical-align: top;
				margin-left: 12rpx;
			}
		}
	}

	.wallet-icon {
		width: 38rpx;
		height: 30rpx;
		vertical-align: middle;
		margin: -6rpx 12rpx 0 0;
	}
</style>
